#include	"delay.h"
 u16 msec=0;
void  delay_ms(u8 ms)
{
	u16 i;
	do
	{
		i = MAIN_Fosc / 10000;
		while(--i)	;
	}while(--ms);
}

void millisecond()
{
	  msec++;
	  if(msec>=0xffff)msec=0;
}
unsigned char t_delay_ms(timeoutDefine *set)
{
 
	if(msec - set->startime >= set->timeout)
	{
		set->startime =msec;
		return 1;
	}
	else
		return 0;
}
